<template>
  <div v-show="props.compType === 'button'">
    <el-form-item label="ID">
      <el-tooltip
        class="item"
        effect="dark"
        content="请注意,ID的修改可能会导致该组件相关事件失效！"
        placement="left"
      >
        <el-input v-model="props.id" class="input"></el-input>
      </el-tooltip>
    </el-form-item>
    <el-form-item label="按钮文字">
      <el-input v-model="props.text" class="input"></el-input>
    </el-form-item>
    <el-form-item label="显示标签">
      <el-switch v-model="props.showLabel" @change="handlerShowLabel"></el-switch>
    </el-form-item>
    <el-form-item v-show="props.showLabel" label="标签文字">
      <el-input v-model="props.label" class="input"></el-input>
    </el-form-item>
    <el-form-item v-show="props.showLabel" label="标签长度">
      <el-input-number v-model="props.labelWidth" :min="1" :max="200"></el-input-number>
    </el-form-item>
    <el-form-item v-show="props.span" label="占用列数">
      <el-input-number v-model="props.span" :min="1" :max="24"></el-input-number>
    </el-form-item>

    <el-form-item label="按钮类型">
      <el-select v-model="props.type" placeholder="请选择">
        <el-option label="primary" value="primary" />
        <el-option label="success" value="success" />
        <el-option label="warning" value="warning" />
        <el-option label="danger" value="danger" />
        <el-option label="info" value="info" />
        <el-option label="text" value="text" />
      </el-select>
    </el-form-item>
    <el-form-item label="按钮大小">
      <el-radio-group v-model="props.size">
        <el-radio-button label="large">大</el-radio-button>
        <el-radio-button label="default">中</el-radio-button>
        <el-radio-button label="small">小</el-radio-button>
      </el-radio-group>
    </el-form-item>
    <el-form-item label="是否显示">
      <el-switch v-model="props.isShow"></el-switch>
    </el-form-item>
    <el-form-item label="禁用">
      <el-switch v-model="props.disabled"></el-switch>
    </el-form-item>
    <el-form-item label="简单样式">
      <el-switch v-model="props.plain"></el-switch>
    </el-form-item>
    <el-form-item label="圆角">
      <el-switch v-model="props.round"></el-switch>
    </el-form-item>
    <el-form-item label="圆形">
      <el-switch v-model="props.circle"></el-switch>
    </el-form-item>
    <el-form-item label="JS脚本">
      <el-input v-model="props.jstext" class="input"></el-input>
    </el-form-item>
  </div>
</template>
<script>
  /**
   * input的配置项
   */
  export default {
    name: 'ButtonConfig',
    props: {
      props: {},
    },
    data() {
      return {
        iconDialogVisible: false,
      };
    },
    mounted() {},
    methods: {
      handlerShowLabel(val) {
        if (val) {
          this.props.labelWidth = 80;
        } else {
          this.props.labelWidth = 0;
        }
      },
      handlerSelectIcon() {
        this.iconDialogVisible = true;
      },
    },
  };
</script>
